# -*- mode: Makefile; -*-

################################################################################
## common files
################################################################################

libavocado_a_SOURCES = \
	Basics/ConditionLocker.cpp \
	Basics/ConditionVariable.cpp \
	Basics/FileUtils.cpp \
	Basics/Initialise.cpp \
	Basics/LibraryLoader.cpp \
	Basics/Mutex.cpp \
	Basics/MutexLocker.cpp \
	Basics/ProgramOptions.cpp \
	Basics/ProgramOptionsDescription.cpp \
	Basics/Random.cpp \
	Basics/ReadLocker.cpp \
	Basics/ReadUnlocker.cpp \
	Basics/ReadWriteLock.cpp \
	Basics/StringUtils.cpp \
	Basics/Thread.cpp \
	Basics/Timing.cpp \
	Basics/WriteLocker.cpp \
	Basics/WriteUnlocker.cpp \
	BasicsC/associative-multi.c \
	BasicsC/associative.c \
	BasicsC/conversions.c \
	BasicsC/csv.c \
	BasicsC/error.c \
	BasicsC/files.c \
	BasicsC/hashes.c \
	BasicsC/init.c \
	BasicsC/json.c \
	BasicsC/locks-macos.c \
	BasicsC/locks-posix.c \
	BasicsC/logging.c \
	BasicsC/memory.c \
	BasicsC/process-utils.c \
	BasicsC/random.c \
	BasicsC/socket-utils.c \
	BasicsC/string-buffer.c \
	BasicsC/strings.c \
	BasicsC/structures.c \
	BasicsC/system-functions.c \
	BasicsC/terminal-utils-ncurses.c \
	BasicsC/terminal-utils.c \
	BasicsC/threads-posix.c \
	BasicsC/vector.c \
	BasicsC/voc-errors.c \
	JsonParser/json-parser.c \
	JsonParserX/InputParser.cpp \
	JsonParserX/JsonParserX.cpp \
	JsonParserX/JsonParserXDriver.cpp \
	JsonParserX/JsonScannerX.cpp \
	Logger/Logger.cpp \
	Logger/LoggerData.cpp \
	Logger/LoggerInfo.cpp \
	Logger/LoggerStream.cpp \
	Logger/LoggerTiming.cpp \
	MRuby/MRLineEditor.cpp \
	ProgramOptions/program-options.c \
	Rest/AddressPort.cpp \
	Rest/AnyServer.cpp \
	Rest/HttpRequest.cpp \
	Rest/HttpResponse.cpp \
	Rest/Initialise.cpp \
	Rest/JsonContainer.cpp \
	Rest/SslInterface.cpp \
	Rest/Url.cpp \
	ShapedJson/json-shaper.c \
	ShapedJson/shape-accessor.c \
	ShapedJson/shaped-json.c \
	UserManager/ApplicationUserManager.cpp \
	UserManager/Role.cpp \
	UserManager/Session.cpp \
	UserManager/SessionHandler.cpp \
	UserManager/User.cpp \
	UserManager/UserHandler.cpp \
	UserManager/UsersHandler.cpp \
	Utilities/LineEditor.cpp \
	V8/JSLoader.cpp \
	V8/v8-conv.cpp \
	V8/v8-json.cpp \
	V8/V8LineEditor.cpp \
	V8/v8-shell.cpp \
	V8/v8-utils.cpp \
	Variant/VariantArray.cpp \
	Variant/VariantBlob.cpp \
	Variant/VariantBoolean.cpp \
	Variant/VariantDate.cpp \
	Variant/VariantDatetime.cpp \
	Variant/VariantDouble.cpp \
	Variant/VariantFloat.cpp \
	Variant/VariantInt16.cpp \
	Variant/VariantInt32.cpp \
	Variant/VariantInt64.cpp \
	Variant/VariantInt8.cpp \
	Variant/VariantMatrix2.cpp \
	Variant/VariantNull.cpp \
	Variant/VariantObject.cpp \
	Variant/VariantString.cpp \
	Variant/VariantUInt16.cpp \
	Variant/VariantUInt32.cpp \
	Variant/VariantUInt64.cpp \
	Variant/VariantUInt8.cpp \
	Variant/VariantVector.cpp

################################################################################
## avocado server
################################################################################

avocado_LDADD = libavocado.a $(LIBS)

avocado_SOURCES = \
	Admin/ApplicationAdminServer.cpp \
	Admin/RestAdminBaseHandler.cpp \
	Admin/RestAdminFeConfigurationHandler.cpp \
	Admin/RestAdminLogHandler.cpp \
	Admin/RestBaseHandler.cpp \
	Admin/RestVersionHandler.cpp \
	ApplicationServer/ApplicationServer.cpp \
	ApplicationServer/ApplicationServerImpl.cpp \
	ApplicationServer/ApplicationServerSchedulerImpl.cpp \
	Dispatcher/ApplicationServerDispatcher.cpp \
	Dispatcher/ApplicationServerDispatcherImpl.cpp \
	Dispatcher/DispatcherImpl.cpp \
	Dispatcher/DispatcherQueue.cpp \
	Dispatcher/DispatcherThread.cpp \
	Dispatcher/Job.cpp \
	GeneralServer/GeneralFigures.cpp \
	GeoIndex/GeoIndex.c \
	HashIndex/hashindex.c \
	HttpServer/ApplicationHttpServer.cpp \
	HttpServer/ApplicationHttpServerImpl.cpp \
	HttpServer/HttpCommTask.cpp \
	HttpServer/HttpHandler.cpp \
	HttpServer/HttpHandlerFactory.cpp \
	HttpServer/PathHandler.cpp \
	HttpServer/RedirectHandler.cpp \
	HttpServer/ServiceUnavailableHandler.cpp \
	HttpsServer/ApplicationHttpsServer.cpp \
	HttpsServer/ApplicationHttpsServerImpl.cpp \
	HttpsServer/HttpsAsyncCommTask.cpp \
	HttpsServer/HttpsServer.cpp \
	HttpsServer/HttpsServerImpl.cpp \
	PriorityQueue/pqueueindex.c \
	PriorityQueue/priorityqueue.c \
	Ahuacatl/ast-codegen-js.c \
        Ahuacatl/ast-dump.c \
        Ahuacatl/ast-node.c \
        Ahuacatl/error.c \
        Ahuacatl/grammar.c \
        Ahuacatl/parser.c \
        Ahuacatl/tokens.c \
	QL/ast-query.c \
	QL/formatter.c \
	QL/optimize.c \
	QL/parser.c \
	QL/tokens.c \
	RestHandler/RestActionHandler.cpp \
	RestHandler/RestDocumentHandler.cpp \
	RestHandler/RestEdgeHandler.cpp \
	RestHandler/RestImportHandler.cpp \
	RestHandler/RestVocbaseBaseHandler.cpp \
	RestServer/ActionDispatcherThread.cpp \
	RestServer/AvocadoHttpServer.cpp \
	RestServer/AvocadoServer.cpp \
	RestServer/avocado.cpp \
	ResultGenerator/HtmlResultGenerator.cpp \
	ResultGenerator/Initialise.cpp \
	ResultGenerator/JsonResultGenerator.cpp \
	ResultGenerator/JsonXResultGenerator.cpp \
	ResultGenerator/OutputGenerator.cpp \
	ResultGenerator/PhpResultGenerator.cpp \
	ResultGenerator/ResultGenerator.cpp \
	ResultGenerator/XmlResultGenerator.cpp \
	Scheduler/AsyncTask.cpp \
	Scheduler/ConnectionTask.cpp \
	Scheduler/ListenTask.cpp \
	Scheduler/PeriodicTask.cpp \
	Scheduler/Scheduler.cpp \
	Scheduler/SchedulerLibev.cpp \
	Scheduler/SchedulerThread.cpp \
	Scheduler/SignalTask.cpp \
	Scheduler/SocketTask.cpp \
	Scheduler/Task.cpp \
	Scheduler/TaskManager.cpp \
	Scheduler/TimerTask.cpp \
	SkipLists/sl-operator.c \
	SkipLists/skiplist.c \
	SkipLists/skiplistIndex.c \
	V8/v8-actions.cpp \
	V8/v8-vocbase.cpp \
	VocBase/barrier.c \
	VocBase/blob-collection.c \
	VocBase/collection.c \
	VocBase/compactor.c \
	VocBase/datafile.c \
	VocBase/document-collection.c \
	VocBase/headers.c \
	VocBase/index.c \
	VocBase/query-base.c \
	VocBase/query-cursor.c \
	VocBase/query-data-feeder.c \
	VocBase/query-execute.c \
	VocBase/query-functions.c \
	VocBase/query-javascript.c \
	VocBase/query-join.c \
	VocBase/query-join-execute.c \
	VocBase/query-locks.c \
	VocBase/query-memory.c \
	VocBase/query-node.c \
	VocBase/query-order.c \
	VocBase/query-parse.c \
	VocBase/query-result.c \
	VocBase/query.c \
	VocBase/shadow-data.c \
	VocBase/simple-collection.c \
	VocBase/synchroniser.c \
	VocBase/voc-shaper.c \
	VocBase/vocbase.c

################################################################################
## avocado shell
################################################################################

avocsh_LDADD = libavocado.a $(LIBS)

avocsh_SOURCES = \
	SimpleHttpClient/SimpleHttpClient.cpp \
	SimpleHttpClient/SimpleHttpResult.cpp \
	V8Client/ImportHelper.cpp \
	V8Client/V8ClientConnection.cpp \
	V8Client/avocsh.cpp

################################################################################
## avocado ruby shell
################################################################################

avocirb_LDADD = libavocado.a $(LIBS)

avocirb_SOURCES = \
	MRClient/avocirb.cpp

################################################################################
## avocado importer
################################################################################

avocimp_LDADD = libavocado.a $(LIBS)

avocimp_SOURCES = \
	SimpleHttpClient/SimpleHttpClient.cpp \
	SimpleHttpClient/SimpleHttpResult.cpp \
	V8Client/ImportHelper.cpp \
	V8Client/V8ClientConnection.cpp \
	V8Client/avocimp.cpp

################################################################################
## JavaScript source code as header
################################################################################

JAVASCRIPT_HEADER = \
	js/common/bootstrap/js-errors.h \
	js/common/bootstrap/js-modules.h \
	js/common/bootstrap/js-print.h \
	js/common/bootstrap/js-errors.h \
	js/client/js-client.h \
	js/server/js-aql-operators.h \
	js/server/js-aql-functions-numeric.h \
	js/server/js-aql-functions-string.h \
	js/server/js-server.h \
	js/server/js-ahuacatl.h

BUILT_SOURCES += $(JAVASCRIPT_HEADER)

################################################################################
## FLEX
################################################################################

FLEX_FILES = \
	JsonParser/json-parser.c \
	QL/tokens.c \
        Ahuacatl/tokens.c

BUILT_SOURCES += $(FLEX_FILES)

################################################################################
## FLEX++
################################################################################

FLEXXX_FILES = \
	V8/v8-json.cpp \
	JsonParserX/JsonScannerX.cpp

BUILT_SOURCES += $(FLEXXX_FILES)

################################################################################
## BISON
################################################################################

BISON_FILES = \
	QL/parser.c \
	Ahuacatl/grammar.c

BUILT_SOURCES += $(BISON_FILES)

################################################################################
## BISON++
################################################################################

BISONXX_FILES = \
	JsonParserX/JsonParserX.cpp

BUILT_SOURCES += $(BISONXX_FILES)

################################################################################
## DOXYGEN
################################################################################

DOXYGEN = \
	Doxygen/js/actions/system/api-collection.c \
	Doxygen/js/actions/system/api-edges.c \
	Doxygen/js/actions/system/api-index.c \
	Doxygen/js/actions/system/api-simple.c \
	Doxygen/js/actions/system/api-system.c \
	Doxygen/js/common/bootstrap/modules.c \
	Doxygen/js/common/bootstrap/print.c \
	Doxygen/js/common/modules/graph.c \
	Doxygen/js/common/modules/jsunity.c \
	Doxygen/js/server/modules/actions.c \
	Doxygen/js/server/modules/simple-query.c \
	Doxygen/js/server/server.c

################################################################################
## wiki
################################################################################

WIKI = \
	AQLBasics \
	Actions \
	AvocadoErrors \
	AvocadoScript \
	CommandLine \
	CommandLineAvocado \
	CommandLineLogging \
	CommandLineRandom \
	CommandLineScheduler \
	Compiling \
	DBAdmin \
	DefineAction \
	ExamplesSetup \
	Glossary \
	Graphs \
	Home \
	HttpCollection \
	HttpIndex \
	HttpInterface \
	HttpSystem \
	IndexGeo \
	IndexHash \
	IndexSkiplist \
	IndexUsage \
	Indexes \
	InstallManual \
	Installing \
	JSModuleActions \
	JSModuleConsole \
	JSModuleFs \
	JSModuleGraph \
	JSModuleInternal \
	JSModules \
	JavaScriptFunc \
	JavaScriptFuncIndex \
	Key-Value \
	OTWP \
	Optimizer \
	RefManual \
	RestCursor \
	RestDocument \
	RestEdge \
	RestSystem \
	ShellCollection \
	ShellDocument \
	ShellEdge \
	ShellIndex \
	SimpleQueries \
	UserManualServer \
	UserManualShell \
	UserManualShellStartStop  \
	jsUnity
